package com.example.seckill.result;

import lombok.AllArgsConstructor;
import lombok.Data;

// 1. 首先创建返回结果类
@Data
@AllArgsConstructor
public class SeckillResult {
    private boolean success;
    private String message;
    private Object data;

    public static SeckillResult success(Object data) {
        return new SeckillResult(true, null, data);
    }


    public static SeckillResult success(String message) {
        return new SeckillResult(true, message, null);
    }
    
    public static SeckillResult fail(String message) {
        return new SeckillResult(false, message, null);
    }

}